<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">

        <!-- 分析 -->
        <!-- 1. 我们要监听到文本框数据的改变,这样才能知道什么时候去拼接出一个 fullname -->
        <!-- 2. 如何监听到文本框的数据改变呢??? -->
        <input type="text" v-model="firstName" @keyup="getFullName">+
        <input type="text" v-model="lastName" @keyup="getFullName">=
        <input type="text" v-model="fullName">

    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                firstName: '',
                lastName: '',
                fullName: ''
            },
            methods: {
                getFullName() {
                    this.fullName = this.firstName + '-' + this.lastName
                }
            }
        });
    </script>
</body>

</html>